
@extends('home.base.index')

@section('content')
    <!--内容开始-->
    <div class="personal w1200">
    	<div class="personal-left f-l">
        	<div class="personal-l-tit">
            	<h3>个人中心</h3>
            </div>
            <ul>
            	   <li class="current-li per-li1"><a href="#">消息中心<span>></span></a></li>
                <li class="per-li2"><a href="{{url('/home/userinfo')}}">个人资料<span>></span></a></li>
                <li class="per-li3"><a href="/home/userorder">我的订单<span>></span></a></li>
                <li class="per-li6"><a href="/home/address">管理收货地址<span></span></a></li>
                <li class="per-li7"><a href="/home/interest">商品收藏<span></span></a></li>
                <li class="per-li8"><a href="/home/okconfirm">确认收货<span>></span></a></li>
                <li class="per-li9"><a href="#">浏览记录<span>></span></a></li>
                <li class="per-li10"><a href="#">会员积分<span>></span></a></li>
            </ul>
        </div>
    	<div class="management f-r">
            <div class="tanchuang-con">
                <div class="tc-title">
                    <h3>我的收货地址</h3>
                </div>

                 <form action='/home/address' method='post' name='myform'>
                        <input type='hidden' name='_token' value='{{ csrf_token() }}'>
                        <input type='hidden' name='_method' value='DELETE'>
                    </form>
                <div class="man-info">
                <table class="table tile">
                <div class="man-if-con">
                    <div class="man-tit">
                        <p class="p1">收货人</p>
                        <p class="p1">省份</p>
                        <p class="p3">详细地址</p>
                        <p class="p4">电话/手机</p>
                        <p class="p6">操作</p>
                    </div>
                     @if (empty($address))
                           
                      @else
                          @foreach($address as $v)
                             <ul class="man-ul1">
                                <li>
                                    <p class="p1">{{ $v->receive_name }}</p>
                                    <p class="p1">{{ $v->province }}</p>
                                    <p class="p3">{{ $v->address }}</p>
                                    <p class="p4">{{ $v->telephone }}</p>
                                    <p class="p6">
                                    <a href="/home/address/{{ $v->id }}/edit">修改</a>  
                                    <a href="javascript:doDel({{ $v->id }})">删除</a>
                                         </p>
                                    <div style="clear:both;"></div>

                                </li>
                             </ul>
                          @endforeach
                    @endif   
                </div>
            </table>
            </div>
        <a href="{{ url('/home/aja') }}"><button class="btn-pst2">使用新地址</button></a>

         <script type="text/javascript">
                        function doDel(id)
                        {
                            if(confirm('确定要删除吗？')){
                                var form = document.myform;
                                form.action = '/home/address/'+id;
                                form.submit()
                            }
                        }
                    </script>
            </div>
           
    
    @stop
